package com.qumap.item.test.iteminfo.item1;

import com.google.gwt.core.client.GWT;
import com.qumap.item.content.ObjectOnMapShort;
import com.qumap.item.request.ItemFilterAndLoadProcessor;
import com.qumap.item.info.ImageContainer;
import com.qumap.edititem.update.IItemUpdateProcessorAsync;
import com.qumap.item.test.iteminfo.TestEditItemInfo;
import com.qumap.item.test.iteminfo.item1.filter.TestFilterDisplay;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 17.05.11
 * Time: 18:33
 * To change this template use File | Settings | File Templates.
 */
public class TItem1 extends TestEditItemInfo {

	public static final String TYPE = "ObjectOnMapShort";

    private final IItemUpdateProcessorAsync update_processor = GWT.create(Ttem1UpdateProcessor.class);
    private final ItemFilterAndLoadProcessor filter_display = new TestFilterDisplay();


    private final ImageContainer image_container_less_100 = new ImageContainer();
    private final ImageContainer image_container_above_100 = new ImageContainer();

	public TItem1() {
		type = TYPE;
        image_container_less_100.getIconInfo().setImageURL("/recources/icong.png");
        image_container_less_100.getShadowInfo().setImageURL("/recources/shadow-icong.PNG");

        image_container_above_100.getIconInfo().setImageURL("/recources/iconr.png");
        image_container_above_100.getShadowInfo().setImageURL("/recources/shadow-icong.PNG");

	}


    @Override
    public ImageContainer getContainerByContent(ObjectOnMapShort content) {
        if(content.getId() < 100)
            return image_container_less_100;
        return image_container_above_100;
    }




    @Override
    public ObjectOnMapShort createContent() {
        return new ObjectOnMapShort();
    }

    @Override
    public ItemFilterAndLoadProcessor getFilterDisplay() {
        return filter_display;
    }

    @Override
    public IItemUpdateProcessorAsync getItemChanger() {
        return update_processor;
    }
}
